<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<f:view>
	<h:form id='form'>
		<head>
<f:loadBundle basename="messages" var="msgs" />
<title><h:outputText value="#{msgs.title}" /></title>

		</head>
		<body>
			<ui:include src="header/header.xhtml" />

			<br />
			<br />
			<br />

			<h:outputText value="#{msg.user_title}" />

			<p></p>


			<div id="div">
				<table class="display" id="user_table">
					<tr>
						<td><h:outputLabel value="#{msg.username}"></h:outputLabel></td>
						<td>
							<h:inputText id="username" value="#{register.username}" required="true" maxlength="20" size="20">
								<f:validator validatorId="usernameValidator"></f:validator>
								 <f:attribute name="userService" value="#{userService}" />
							</h:inputText> 
						</td>
						<td>
						<h:message for="username" style="color:red" />
						</td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.password }"></h:outputLabel></td>
						<td>
							<h:inputText id="password" binding="#{passwordComponent}" value="#{register.password }" required="true" maxlength="20" size="20">
							</h:inputText>
						</td>
						<td>
						<h:message for="password" style="color:red" />
						</td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.reEnterPassword }"></h:outputLabel></td>
						<td>
							<h:inputText id="confirmPassword" value="#{register.reEnterPassword }" required="#{not empty passwordComponent.value}">
								<f:validator validatorId="confirmPasswordValidator" />
   		 						<f:attribute name="passwordComponent" value="#{passwordComponent}" />
							</h:inputText>
						</td>
						<td>
							<h:message for="confirmPassword" />
						</td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.email}"></h:outputLabel></td>
						<td><h:inputText value="#{register.email}">
							</h:inputText> 
						</td>
						<td></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.address }"></h:outputLabel></td>
						<td><h:inputText value="#{register.address }"></h:inputText></td>
						<td></td>
					</tr>


					<tr>
						<td><h:outputLabel value="#{msg.postadress }"></h:outputLabel>
						</td>
						<td><h:inputText value="#{register.postAddress }"></h:inputText>
						</td>
						<td></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.mobile }"></h:outputLabel></td>
						<td><h:inputText value="#{register.mobile }"></h:inputText></td>
						<td></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.phone }"></h:outputLabel></td>
						<td><h:inputText value="#{register.phone }"></h:inputText></td>
						<td></td>
					</tr>


					<tr>
						<td><h:commandButton value="#{msg.submit}"
								action="#{register.registerAction }">
							</h:commandButton></td>
						<td>
							<a href="login.faces">
							<h:outputText value="#{msg.back_to_users}"></h:outputText>
							</a>
						</td>
								<td></td>
					</tr>

				</table>

			</div>

			<p></p>
			<ui:include src="footer/footer.xhtml" />

		</body>
	</h:form>
</f:view>
</html>
